package com.ims.client.util;

import org.apache.pulsar.client.api.AuthenticationFactory;
import org.apache.pulsar.client.api.PulsarClient;


public class GetPulsarClientUtil {

    public static PulsarClient get(String ip, String port) {
       try {
           PulsarClient client;
           client = PulsarClient
                   .builder()
                   .serviceUrl("pulsar://" + ip + ":" + port)
                   .authentication(AuthenticationFactory.token("eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1xIn0.ybJge7zTfy_RDdAtB3w6nIPDHPT6-kbB6sNzgPt8sKQ"))
                   //超管token：eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1xIn0.ybJge7zTfy_RDdAtB3w6nIPDHPT6-kbB6sNzgPt8sKQ
                   .build();
           return client;
       }catch (Exception e){
             System.out.println(e);
             return null;
       }
    }
}
